{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { formatValue, isSameQuarter } from \"../../utils/dateUtil\";\nimport RangeContext from \"../../RangeContext\";\nimport useCellClassName from \"../../hooks/useCellClassName\";\nimport PanelBody from \"../PanelBody\";\nexport var QUARTER_COL_COUNT = 4;\nvar QUARTER_ROW_COUNT = 1;\nfunction QuarterBody(props) {\n  var prefixCls = props.prefixCls,\n    locale = props.locale,\n    value = props.value,\n    viewDate = props.viewDate,\n    generateConfig = props.generateConfig;\n  var _React$useContext = React.useContext(RangeContext),\n    rangedValue = _React$useContext.rangedValue,\n    hoverRangedValue = _React$useContext.hoverRangedValue;\n  var cellPrefixCls = \"\".concat(prefixCls, \"-cell\");\n  var getCellClassName = useCellClassName({\n    cellPrefixCls: cellPrefixCls,\n    value: value,\n    generateConfig: generateConfig,\n    rangedValue: rangedValue,\n    hoverRangedValue: hoverRangedValue,\n    isSameCell: function isSameCell(current, target) {\n      return isSameQuarter(generateConfig, current, target);\n    },\n    isInView: function isInView() {\n      return true;\n    },\n    offsetCell: function offsetCell(date, offset) {\n      return generateConfig.addMonth(date, offset * 3);\n    }\n  });\n  var baseQuarter = generateConfig.setDate(generateConfig.setMonth(viewDate, 0), 1);\n  return /*#__PURE__*/React.createElement(PanelBody, _extends({}, props, {\n    rowNum: QUARTER_ROW_COUNT,\n    colNum: QUARTER_COL_COUNT,\n    baseDate: baseQuarter,\n    getCellText: function getCellText(date) {\n      return formatValue(date, {\n        locale: locale,\n        format: locale.quarterFormat || '[Q]Q',\n        generateConfig: generateConfig\n      });\n    },\n    getCellClassName: getCellClassName,\n    getCellDate: function getCellDate(date, offset) {\n      return generateConfig.addMonth(date, offset * 3);\n    },\n    titleCell: function titleCell(date) {\n      return formatValue(date, {\n        locale: locale,\n        format: 'YYYY-[Q]Q',\n        generateConfig: generateConfig\n      });\n    }\n  }));\n}\nexport default QuarterBody;","map":{"version":3,"names":["_extends","React","formatValue","isSameQuarter","RangeContext","useCellClassName","PanelBody","QUARTER_COL_COUNT","QUARTER_ROW_COUNT","QuarterBody","props","prefixCls","locale","value","viewDate","generateConfig","_React$useContext","useContext","rangedValue","hoverRangedValue","cellPrefixCls","concat","getCellClassName","isSameCell","current","target","isInView","offsetCell","date","offset","addMonth","baseQuarter","setDate","setMonth","createElement","rowNum","colNum","baseDate","getCellText","format","quarterFormat","getCellDate","titleCell"],"sources":["/data/messenger.client/node_modules/rc-picker/es/panels/QuarterPanel/QuarterBody.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { formatValue, isSameQuarter } from \"../../utils/dateUtil\";\nimport RangeContext from \"../../RangeContext\";\nimport useCellClassName from \"../../hooks/useCellClassName\";\nimport PanelBody from \"../PanelBody\";\nexport var QUARTER_COL_COUNT = 4;\nvar QUARTER_ROW_COUNT = 1;\n\nfunction QuarterBody(props) {\n  var prefixCls = props.prefixCls,\n      locale = props.locale,\n      value = props.value,\n      viewDate = props.viewDate,\n      generateConfig = props.generateConfig;\n\n  var _React$useContext = React.useContext(RangeContext),\n      rangedValue = _React$useContext.rangedValue,\n      hoverRangedValue = _React$useContext.hoverRangedValue;\n\n  var cellPrefixCls = \"\".concat(prefixCls, \"-cell\");\n  var getCellClassName = useCellClassName({\n    cellPrefixCls: cellPrefixCls,\n    value: value,\n    generateConfig: generateConfig,\n    rangedValue: rangedValue,\n    hoverRangedValue: hoverRangedValue,\n    isSameCell: function isSameCell(current, target) {\n      return isSameQuarter(generateConfig, current, target);\n    },\n    isInView: function isInView() {\n      return true;\n    },\n    offsetCell: function offsetCell(date, offset) {\n      return generateConfig.addMonth(date, offset * 3);\n    }\n  });\n  var baseQuarter = generateConfig.setDate(generateConfig.setMonth(viewDate, 0), 1);\n  return /*#__PURE__*/React.createElement(PanelBody, _extends({}, props, {\n    rowNum: QUARTER_ROW_COUNT,\n    colNum: QUARTER_COL_COUNT,\n    baseDate: baseQuarter,\n    getCellText: function getCellText(date) {\n      return formatValue(date, {\n        locale: locale,\n        format: locale.quarterFormat || '[Q]Q',\n        generateConfig: generateConfig\n      });\n    },\n    getCellClassName: getCellClassName,\n    getCellDate: function getCellDate(date, offset) {\n      return generateConfig.addMonth(date, offset * 3);\n    },\n    titleCell: function titleCell(date) {\n      return formatValue(date, {\n        locale: locale,\n        format: 'YYYY-[Q]Q',\n        generateConfig: generateConfig\n      });\n    }\n  }));\n}\n\nexport default QuarterBody;"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,WAAW,EAAEC,aAAa,QAAQ,sBAAsB;AACjE,OAAOC,YAAY,MAAM,oBAAoB;AAC7C,OAAOC,gBAAgB,MAAM,8BAA8B;AAC3D,OAAOC,SAAS,MAAM,cAAc;AACpC,OAAO,IAAIC,iBAAiB,GAAG,CAAC;AAChC,IAAIC,iBAAiB,GAAG,CAAC;AAEzB,SAASC,WAAW,CAACC,KAAK,EAAE;EAC1B,IAAIC,SAAS,GAAGD,KAAK,CAACC,SAAS;IAC3BC,MAAM,GAAGF,KAAK,CAACE,MAAM;IACrBC,KAAK,GAAGH,KAAK,CAACG,KAAK;IACnBC,QAAQ,GAAGJ,KAAK,CAACI,QAAQ;IACzBC,cAAc,GAAGL,KAAK,CAACK,cAAc;EAEzC,IAAIC,iBAAiB,GAAGf,KAAK,CAACgB,UAAU,CAACb,YAAY,CAAC;IAClDc,WAAW,GAAGF,iBAAiB,CAACE,WAAW;IAC3CC,gBAAgB,GAAGH,iBAAiB,CAACG,gBAAgB;EAEzD,IAAIC,aAAa,GAAG,EAAE,CAACC,MAAM,CAACV,SAAS,EAAE,OAAO,CAAC;EACjD,IAAIW,gBAAgB,GAAGjB,gBAAgB,CAAC;IACtCe,aAAa,EAAEA,aAAa;IAC5BP,KAAK,EAAEA,KAAK;IACZE,cAAc,EAAEA,cAAc;IAC9BG,WAAW,EAAEA,WAAW;IACxBC,gBAAgB,EAAEA,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